package com.skyline.search.util;

import java.io.File;

public class SearchUtil {
	public static void makefile(String path) {
		File file = new File(path);
		if (!file.exists()) {
			file.mkdirs();
			System.out.println("CreatePath:" + path + "--Success!");
		} else {
			System.out.println("CreatePath:" + path + "--Fail:already exists!");
		}
	}

	public static boolean checkFileExists(String path) {
		File file = new File(path);
		if (!file.exists()) {
			return false;
		} else {
			return true;
		}
	}

	public static boolean checkSubFileExists(String path) {
		File file = new File(path);
		if (!file.exists()) {
			return false;
		} else {
			File subFiles[] = file.listFiles();
			if (subFiles.length > 0)
				return true;
			else
				return false;
		}
	}
}
